package com.service.impl;

import com.dao.OrderdetailetMapper;
import com.model.Orderdetailet;
import com.service.OrderdetailetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderdetailetServiceImpl implements OrderdetailetService {
    @Autowired
    private OrderdetailetMapper mapper;
    @Override
    public  List<Orderdetailet> getOrdersByorderId(int orderId) {
        List<Orderdetailet> orderdetailet=null;
        try {
            orderdetailet = mapper.getOrdersByorderId(orderId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return orderdetailet;
    }
    @Override
    public int saveOrderdetailet(int foodId, int orderId, int quantity){
        int issave=-1;
        try {
            issave=mapper.saveOrderdetailet(foodId,orderId,quantity);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return issave;
    }

}
